import {Injectable} from '@angular/core';
import {LogService} from './log.service';
@Injectable()
export class ProductService {
    constructor(public log: LogService) {
    }

    //定义一个方法,从服务器获取商品信息
    getProduct(): Product {
        this.log.log('log 服务 被注入');
        return new Product('1', 'iphone');
    }
}
//商品信息
export class Product {
    //这里是导出的,必须用public
    constructor(public id: string,
                public name: string) {
    }
}

